Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18656
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
Fixes a build/test failure from D99137671 by adjusting a printf-style format string in the ATen executor tensor layout validation path.
Changes:
- Updated the error message format specifier used when reporting
dim_ordersize mismatches invalidateTensorLayout().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "Dim order size mismatch. Expected %d, got %u.", | ||
| dim, | ||
| s_tensor->dim_order()->size()); |
There was a problem hiding this comment.
The format specifier was changed to %u, but s_tensor->dim_order()->size() is a FlatBuffers vector size type (typically uoffset_t/uint32_t), and %u is not guaranteed to match its underlying type on all platforms (e.g., if uint32_t is unsigned long). To avoid -Wformat/UB and match existing code (see tensor_parser_portable.cpp which uses PRIu32 for FlatBuffers sizes), prefer "%" PRIu32 with an explicit static_cast<uint32_t>(...), or cast to size_t and keep %zu.
| "Dim order size mismatch. Expected %d, got %u.", | |
| dim, | |
| s_tensor->dim_order()->size()); | |
| "Dim order size mismatch. Expected %d, got %zu.", | |
| dim, | |
| static_cast<size_t>(s_tensor->dim_order()->size())); |
### Summary fix failures on [D99137671](https://www.internalfb.com/diff/D99137671) Co-authored-by: Github Executorch <github_executorch@arm.com>
### Summary fix failures on [D99137671](https://www.internalfb.com/diff/D99137671) Co-authored-by: Github Executorch <github_executorch@arm.com>
### Summary fix failures on [D99137671](https://www.internalfb.com/diff/D99137671) Co-authored-by: Github Executorch <github_executorch@arm.com>
Summary
fix failures on D99137671